li = [54, 26, 93, 17, 77, 31, 44, 55, 20]
# for i in range(len(li) - 1):
#     max = li[0]
#     max_index = 0
#     for j in range(len(li) - i):
#         if li[j] > max:
#             max = li[j]
#             max_index = j
#     li[len(li)-i-1], li[max_index] = li[max_index], li[len(li)-i-1]
# print(li)
for i in range(len(li) - 1):
    min = i
    for j in range(i + 1, len(li)):
        if li[j] < li[min]:
            min = j
    li[i], li[min] = li[min], li[i]
print(li)
